/**
 * Copyright (c) 2018 qar All rights reserved.
 *
 * https://www.qar.io
 *
 * 版权所有，侵权必究！
 */

package io.qar.task;

import com.alibaba.fastjson.JSONObject;
import io.qar.commons.tools.utils.Result;
import io.qar.commons.tools.utils.SpringContextUtils;
import io.qar.dto.SysDictTypeDTO;
import io.qar.feign.BusFltInfoFeignClient;
import io.qar.feign.DictFeignClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.Map;

/**
 * 定时同步航班信息表和关联业务表
 */
@Component("insertBusFltTask")
public class InsertBusFltTask implements ITask{
	private Logger logger = LoggerFactory.getLogger(getClass());

	@Autowired
	private BusFltInfoFeignClient busFltInfoFeignClient;


	@Override
	public void run(String params){
		logger.info("InsertBusFltTask定时任务正在执行，参数为：{}", params);
		Map<String, String> map = JSONObject.parseObject(params, Map.class);
		String beginDate = (String) map.get("beginDate");
		String endDate = (String) map.get("endDate");
		Result result = busFltInfoFeignClient.insertBatchs(beginDate, endDate);
		System.out.println(result);
	}
}